package cn.iocoder.yudao.module.trade.job.algorithm;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderDO;
import cn.iocoder.yudao.module.trade.dal.mysql.order.TradeOrderMapper;
import cn.iocoder.yudao.module.trade.enums.order.TradeOrderStatusEnum;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/***
 * 计算积分
 */
@Service
@Slf4j
public class RegionAllScoreService {
    @Resource
    private TradeOrderMapper tradeOrderMapper;

    private void tt() {
        String date = DateUtil.formatDate(new Date());
        String begin_Date = date + "00:00:00";
        String end_Date = date + "23:59:59";

        List<TradeOrderDO> list = tradeOrderMapper.selectList(new LambdaQueryWrapper<TradeOrderDO>()
                .eq(TradeOrderDO::getStatus, TradeOrderStatusEnum.COMPLETED.getStatus())
                .between(TradeOrderDO::getCreateTime, begin_Date, end_Date)
        );
        if (CollUtil.isEmpty(list)) {
            return;
        }

    }
}
